#include<iostream>
using namespace std;
#include<vector>
#include<assert.h>
#include"map_two.hpp"
#include"set_two.hpp"

void test_set()
{
	jyz::set<int> s;
	int a[] = { 4, 2, 6, 1, 3, 5, 15, 7, 16, 14 };
	for (auto e : a)
	{
		s.insert(e);
	}

	for (auto e : s)
	{
		cout << e << " ";
	}
	cout << endl;

	jyz::set<int>::const_iterator it = s.end();
	while (it != s.begin())
	{
		--it;
		cout << *it<<" ";
	}
	cout << endl;
}

void test_map()
{
	jyz::map<int, int> mp;
	int a[] = { 4, 2, 6, 1, 3, 5, 15, 7, 16, 14 };
	for (auto e : a)
	{
		mp.insert({e,e});
	}
	jyz::map<int, int>::iterator it = mp.begin();
	while (it != mp.end())
	{
		cout << it->first << ":" << it->second << endl;
		++it;
	}

	it = mp.end();
	while (it != mp.begin())
	{
		--it;
		cout << it->first << ":" << it->second << endl;
	}
}

int main()
{
	//TestRBAVLTree();
	test_set();
	//test_map();
	return 0;
}